home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 4 / FM Towns Free Software Collection 4 - Disc 1.iso / msdos / css / lib / strlib.c < prev   
Text File  |  1991-10-18  |  732b  |  36 lines

  1.    
  2.    
  3. char *strleft(char *b, char *s, int i)
  4.      {
  5.           char *a;
  6.           int  x;
  7.           a = b;
  8.           for (x = 1; x <= i; ++x)
  9.                *b++ = *s++;
  10.           *b ='\0';
  11.           return(a);
  12.      }
  13.      
  14. char *strmid(char *b, char *s, int  i, int j)
  15.      {
  16.           char *a;
  17.           int  x;
  18.           a = b;
  19.           if ( j != 0 ){
  20.                for (x = 1; x < i; ++x){
  21.                     if (*s++ == '\0'){
  22.                          *b = '\0';
  23.                          return(a);
  24.                     }
  25.                }
  26.                for (x = 1; x <= j; ++x)
  27.                     *b++ = *s++;
  28.           }
  29.           *b = '\0';
  30.           return(a);    
  31.      }
  32.      
  33.  
  34.  
  35.   
  36.